home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Elysian Archive
/
AmigaElysianArchive.iso
/
wp_dtp
/
atap.lha
/
ATAP
/
Creating .metric Files
< prev
next >
Wrap
Text File
|
1992-06-13
|
9KB
|
236 lines
================================================================
Creating .metric files
================================================================
Like I described in "ReadMeFirst.doc", Professional Page gets its spacing info
from .metric files. It also gets kerning information, PostSript typeface
names, and other little tidbits.
Adobe Font Metrics files (AFMs) also contain this kind of info, but PPage
doesn't use them. Hence, ConvertAFM.
================================================================
Using ConvertAFM
================================================================
Since a .metric may hold information for up to four typefaces for styles of
plain, bold, italic, and bolditalic, ConvertAFM can take up to four AFM files
in its command line. Say we have a collection of AFMs for the typeface family
ITC Garamond:
Filename PostScript typeface name
=====================================
GL______.AFM (Garamond-Light)
GB______.AFM (Garamond-Bold)
GLI_____.AFM (Garamond-LightItalic)
GBI_____.AFM (Garamond-BoldItalic)
(Based on filenames for the MS-DOS version of ITC Garamond)
To make a .metric called Garamond.metric, we use ConvertAFM like this:
1.MSDOS3.3> ConvertAFM GL______.AFM GB______.AFM GLI_____.AFM GBI_____.AFM
(Based on the files sitting on DI0: with CrossDOS running)
This will write a .metric file on the current directory named
"Garamond.metric". It generates the filename from the PostScript typeface
names by stripping off the style extensions and adding .metric to the
result.
/* NOTE: If you did this directly on an MS-DOS disk using CrossDOS, the actual
filename will be "GARAMON.MET" because CrossDOS shortens the name to fit
MS-DOS filename conventions. If this is the case, simply do a copy:
1.MSDOS3.3> copy garamon.met fonts:Garamond.metric
since the .metric has to go to FONTS: anyway. Please capitalize the name. */
We can also specify a different .metric filename and path:
1.MSDOS3.3> ConvertAFM GL.AFM GB.AFM GLI.AFM GBI.AFM FONTS:Garamond.metric
as well as specify different paths for the AFMs:
1.MSDOS3.3> CD FONTS:
1.SCSI Device:FONTS> ConvertAFM DI0:GL.AFM DI0:GB.AFM DI0:GLI.AFM DI0:GBI.AFM
This second example would write Garamond.metric to the directory currently
assigned as FONTS:.
ConvertAFM reports the typeface names and order they were entered in,
as well as the .metric filename:
Typefaces chosen for Garamond.metric:
=====================================
Regular: Garamond-Light
Bold: Garamond-Bold
Italic: Garamond-LightItalic
BoldItalic: Garamond-BoldItalic
=====================================
so if you screwed up the order, you can abort with CTRL-C and re-enter the
command. AmigaShell's command history (cursor-up) really helps here.
As it churns through each AFM it gives little progress reports, because
converting an AFM can take some time depending on how many kerning pairs
are available, and I don't want you to think I write buggy software. :-)
Processed Garamond-Light
Processed Garamond-Bold
Processed Garamond-LightItalic
Processed Garamond-BoldItalic
======================================
Garamond.metric Complete.
ConvertAFM automatically recognizes AFMs that use Adobe Standard, Apple
Standard, or Font Specific encoding. If the AFM uses Adobe Standard or
any other encoding scheme, the characters are re-mapped to match the Amiga
character set. This is only crucial for characters between ASCII 161 and 255.
If the AFM uses Apple Standard encoding (typical of public domain typefaces
available for the Macintosh) or Font Specific encoding, they are mapped
as directly listed by ASCII code, and they're treated as "FONT_SPECIFIC" by
Professional Page. This way, the .metric file matches Macintosh screen fonts.
This is a signficant improvment over my BASIC version. Font Specific encoded
typefaces include ZapfDingbats, Symbol, Sonata, or other similar symbol sets
or special character sets.
Kerning pairs are also closely recorded. Since they're listed by character
name in the AFM, the kerning info is also dependant on the encoding scheme.
Font Specific encoded typefaces usually don't have kerning info, and if they
do, it's ignored by ConvertAFM. Apple Standard encoded AFMs' kerning
tables are valid between ASCII 32 and 127 (IE: The normal charset). Adobe
Standard and others have valid kerning across the entire ASCII range.
Custom .metric Organizations
Not all typeface families have just four typefaces for regular, bold, etc.
so ConvertAFM allows for custom .metric files with fewer AFMs converted.
Take Adobe Garamond for example:
AGaramond-Regular
AGaramond-Italic
AGaramond-SemiBold
AGaramond-SemiBoldItalic
AGaramond-Bold
AGaramond-BoldItalic
/* NOTE: Adobe Garamond has 600+ (!) kerning pairs for each typeface, and
ConvertAFM handles these nicely! */
You obviously can't squeeze six AFMs into one .metric (That's lack of
foresight for you, Gold Disk!) So, I like to group the differet weights
with their matching italics. The result: three unique .metric files.
We can omit a style by inserting a dummy filename (in this case an "x"):
1.AFM Disk:> ConvertAFM AGR.AFM x AGI.AFM x AdobeGaramond.metric
I specified a different .metric filename because the basenames of all these
typefaces are all the same, and the next .metric would overwrite the last
otherwise! Do the same for the other two weights:
1.AFM Disk:> ConvertAFM AGSB.AFM x AGSBI.AFM x AdobeGaramondSemiBold.metric
1.AFM Disk:> ConvertAFM AGB.AFM x AGBI.AFM x AdobeGaramondBold.metric
A progress report for one of these would look like this:
Typefaces chosen for AdobeGaramond.metric:
=====================================
Regular: AGaramond-Regular
Bold: (No .AFM Given)
Italic: AGaramond-Italic
BoldItalic: (No .AFM Given)
=====================================
Processed AGaramond-Regular
Processed AGaramond-Italic
=====================================
AdobeGaramond.metric Complete.
Match these up with the different weights of screen fonts and you have a good
working combo. BTW, Adobe Systems DOES supply screen fonts for EACH AND EVERY
typeface they publish, including different weights and italic versions.
For single typeface families, such as Linoscript, you can omit the other
three AFM entries easily:
1.AFM Disk:> ConvertAFM LinoScr.AFM x x x
Unusually Named Families
Numbered typefaces become hell for ConvertAFM. It can't extract its own
.metric filename because the typeface weight number is part of the basename!
Take Calson for example:
Calson540-Roman
Calson3-Roman
Calson540-Italic
Calson3-Italic
They're in the right order (Regular, bold, etc.) and they can fit into one
.metric, but ConvertAFM will complain. Supplying an alternale .metric filename
will override this check:
1.AFM Disk:> ConvertAFM C540R.AFM C3R.AFM C540I.AFM C3I.AFM Calson.metric
If you're one style short, that's OK. Look at Goudy Extra Bold:
Goudy-ExtraBold
Goudy-Heavyface
Goudy-HeavyfaceItalic
Just do this:
1.AFM Disk:> ConvertAFM GEB.AFM x GH.AFM GHI.AFM GoudyXBold&Heavyface.metric
You don't need the alternate filename this time, but just in case you had
the original Goudy series, this won't overwrite it.
The golden rules for .metric organization are:
==============================================
1) Keey typeface families together. Don't supply alternate .metric filenames
unless you REALLY want these typefaces in one .metric. Let the basename check
work for you.
2) For large families, separate into weights. Keep regulars with italics,
and use logical .metric filenames. Don't be afraid to use long filenames.
3) Beware of numbered typefaces. Read the AFMs to make sure they belong
to the same family, and make sure you enter them in the right order.
4) If you add new weights to a family you have (like Helvetica) you should
reorganize your .metrics into different weights as per 2), just to keep
things organized. This means, Don't put:
Helvetica25-UltraLight
Helvetica95-Black
Helvetica26-UltraLightItalic
Helvetica96-BlackItalic
into one .metric. It'll work OK, but you'll lose youself looking for those
heavier weights.
5) Keep screen font names and .metric names matched! If you convert a screen
font called "AdobeGaramond", make sure the .metric filename is
"AdobeGaramond.metric". Basic rule.
End of this one. Included are two sample AFMs, one with AdobeStandard encoding
and one with Font Specific. In case you have a problem with a particular AFM,
compare it to these two examples. If they don't match, or if one keyword is
out of place, simply move it to the correct position. AFMs are simply text
files, and are editable with ED, MEmacs, or any word processor.
FINAL NOTE ON TEXT TRANSLATION: Since AFMs are text files, they're subject
to different end-of-line rules between operating systems. ConvertAFM will
work with AFM files with Amiga (Linefeed only), Macintosh (Carriage Return
only), or MS-DOS (Carriage Return plus Linefeed) EOL marks. This was inherent
in the BASIC version, and I felt I had to include it in the C version, too.